package com.zlp.redis;

import redis.clients.jedis.Jedis;

public class Demo1 {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("42.192.143.202", 6379);
        jedis.auth("Zlp123456");
        testString(jedis);
        jedis.close();
    }

    public static void testConnect(Jedis jedis){
        String pong = jedis.ping();
        System.out.println("连接成功：" + pong);
    }
    public static void testString(Jedis jedis){
        jedis.set("name","zlp");
        String name = jedis.get("name");
        System.out.println(name);
    }
}
